(function(){
	'use strict';
	angular.module('services.workOrderData.eventMgmt')
	.factory('eventTrendFactory',eventTrendFactory);
	function eventTrendFactory(Restangular){
		return {
			queryTrend: queryTrend,
			getShortName: getShortName
		};
		function queryTrend(params,callback){
			Restangular.all('sas/workOrderData/eventTrend/query').post(params).then(callback);
		}
		
		function getShortName(send){
			var smallName = '' ;
			var code = send.measureIndexCode;
			if(code === 'h3001' || code === 'h3002'){
				smallName = '各科室';
			}else if(code === 'h3003' || code === 'h3007' || code === 'h3008' || code === 'h3009'){
				smallName = '各系统';
			}else if(code === 'h3004' || code === 'h3006'){
				send.changeTypeCode === '1' ? smallName = '各科室事件单' : smallName = '各系统事件单';
			}else {
				send.changeTypeCode === '1' ? smallName = '各科室' : smallName = '各系统';
			}
			return smallName;
		}
	}
})();